<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue-router路由</title>
</head>
<body>
<div id="app">
  <!-- 配置路径 -->
  <router-link to="/home">主页</router-link>
  <router-link to="/top">热点</router-link>
  <router-link to="/abouts">关于我们</router-link>
  <!-- 显示的内容 -->
  <router-view></router-view>
</div>
<script src="../instances/vue.js"></script>
<script src="../instances/vue-router.js"></script>
<script>
    // 模板内容
    let Home = {
      template: `<div>主页</div>`
    }

    let Top = {
      template: `<div>热点</div>`
    }

    let Abouts = {
      template: `<div>关于我们</div>`
    }

    let router = new VueRouter({
      routes: [{
        path: '/home',
        component: Home
      }, {
        path: '/top',
        component: Top
      }, {
        path: '/abouts',
        component: Abouts
      }]
    })

    let vm = new Vue({
        el: "#app",
        router
    })
</script>
</body>
</html>